package org.lim.lcpicturebackend.common;

import lombok.Data;
import org.lim.lcpicturebackend.exception.ErrorCode;

import java.io.Serializable;

@Data
public class BaseResponse<T> implements Serializable {
    private int code;
    private T data;
    private String message;

    public BaseResponse(int code, T data, String message) {
        this.code = code;
        this.data = data;
        this.message = message;
    }
    public BaseResponse(int code, T data){
        this(code,data,"");
    }
    public BaseResponse(int code, String message){
        this(code,null,message);
    }
    public BaseResponse(ErrorCode errorCode){
        this(errorCode.getCode(),null,errorCode.getMessage());
    }

}
